package pl.edu.pw.perg.compinfodb.manager;

import java.util.List;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import pl.edu.pw.perg.compinfodb.dao.IAttributeDAO;
import pl.edu.pw.perg.compinfodb.entities.attribute.Attribute;

public class AttributeManager extends GenericManager<Attribute>{

	public static final String ELEMENT = "element";
	public static final String TYPE = "type";

	private IAttributeDAO attributeDAO;

	public IAttributeDAO getAttributeDAO() {
		return attributeDAO;
	}

	public void setAttributeDAO(IAttributeDAO attributeDAO) {
		this.attributeDAO = attributeDAO;
	}

	@Transactional(readOnly = true, propagation = Propagation.REQUIRED)
	public List<Attribute> findAttributes(String property, Object value) {
		return attributeDAO.findAttributes(property, value);
	}

}
